from django.db import models

class User(models.Model):
	name = models.CharField(max_length=100)
	lastname = models.CharField(max_length=100)
	username = models.CharField(max_length=100, unique=True)
	password = models.CharField(max_length=40)
	cardNumber = models.CharField(max_length=10, unique=True)
	address = models.CharField(max_length=200)
	privilage = models.IntegerField()
	phoneNumber = models.CharField(max_length=9)
	

class Token(models.Model):
	 user = models.ForeignKey('User', unique=True)
	 token = models.CharField(max_length=40)
	 dueDate= models.DateTimeField()


class Hooligan(models.Model):
	name= models.CharField(max_length=100)
	lastname= models.CharField(max_length=100,null=True)
	photoUrl= models.CharField(max_length=100,null=True)
	user = models.ForeignKey('User')
	date = models.DateTimeField()


class OffenseType(models.Model):
	name= models.CharField(max_length=100)
	harmfulness= models.IntegerField()
	overview= models.CharField(max_length=300)



class Event (models.Model):
	offenseType =  models.ForeignKey('OffenseType', null=True, blank=True)
	user = models.ForeignKey('User')
	hooligans = models.ManyToManyField('Hooligan')
	coordinatesWidth= models.FloatField()
	coordinatesHeight= models.FloatField()
	date= models.DateTimeField()